$(() => {

    let getUser = function () {
        $.ajax({
            type: 'get',
            url: 'http://localhost:8080/api/v1/admin/user/info',
            headers: {
                Authorization: localStorage.getItem('dsj_token')
            },
            success: (res) => {

                $('.user_info img ,.user_center_link img').prop('src', res.data.userPic)
                $('.user_info span i').text(res.data.nickname)
            }
        })
    }
    getUser()

    $('.header_bar .logout').on('click', function () {
        localStorage.removeItem('dsj_token')
        location.href = 'login.html'
    })

    $('.level01').on('click', function () {

        $(this).addClass('active').siblings().removeClass('active')
        if ($(this).hasClass('l2')) {
            $(this).next().slideToggle()
            $(this).find('.icon-arrowdownl').toggleClass('rotate0')
        }
    })


})